package com.wwwarehouse.resource_center.fragment.rules;

import android.view.View;
import android.widget.Button;

import com.wwwarehouse.common.bean.response.CommonClass;
import com.wwwarehouse.resource_center.R;

/**
 * @author Joseph on 2017/8/14.
 *         <p/>
 *         任务卡入口
 */
public class ConfiguringTaskRulesFragmrnt extends TheParentFragment {

    private Button mAddTo;         //添加到已有规则中
    private Button mNewlyAdded;    //新增一个分配规则

    @Override
    protected int getContentId() {
        return R.layout.fragment_rule_configuring_task;
    }

    @Override
    protected void init(View view) {
        mAddTo = findView(view, R.id.add_to_rules);
        mNewlyAdded = findView(view, R.id.newly_added_rules);
    }

    @Override
    protected void loadDatas() {

        mAddTo.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                pushFragment(new SelectExistingRulesFragment());
            }
        });

        mNewlyAdded.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                pushFragment(new SetRulesFragment());

            }
        });
    }

    @Override
    public void setTitle() {
        if (peekFragment() instanceof ConfiguringTaskRulesFragmrnt)
            mActivity.setTitle(getString(R.string.configuring_task_rules));
    }

    @Override
    public void requestDatas() {

    }

    @Override
    public void onSuccess(CommonClass commonClass, int i) {

    }


    @Override
    public void onReLoad(int code) {

    }
}
